#This to obtain:
#table_A19.tex
rm(list = ls())

library("broom")
library("dplyr")
library("grid")
library("tidyr")
library("sandwich")
library("lfe")
library("broom")
library("dplyr")
library("tidyr")
library("grid")
library("stargazer")
library("lmtest")
library("multiwayvcov")
library("ggplot2")
library("glue")
library("spdep")
library("spatialreg")
library("stringr")

setwd("/Users/bgpopescu/")
setwd("/Users/bogdan.popescu/")
#setwd("C:/Users/bogdanp/")


#################################
#Function for spatial regression#
#################################
spatial_regression <- function(data_sample, y, x, unique_observation_id) {
  clean_x = clean_list(x, "quad")
  clean_x = clean_list(clean_x, "bfe")
  
  specification = as.formula(paste(glue("{y}~"), 
                                   paste(clean_x, collapse = "+")))
  bw<-subset(data_sample, select =c(x, y, unique_observation_id))
  #Removing NAs
  bw<-bw[!sf::st_is_empty(bw), ]
  bw<-na.omit(bw)
  #Step1: the function "poly2nb" builds a neighbours list based on
  list_nb=poly2nb(bw, row.names = dplyr::pull(bw, unique_observation_id))
  #Step2: Convert nb to listw type
  list_nb_w=tryCatch(nb2listw(list_nb, zero.policy=TRUE), error=function(err) NA)
  #Step3: Spatial Filtering
  reg1_res_sp<-tryCatch(SpatialFiltering(specification,
                                         data = bw,
                                         nb = list_nb,
                                         style="W",
                                         ExactEV = F,
                                         zero.policy = T,
                                         na.action=na.exclude),
                        error=function(err) NA)
  
  print("Done Spatial Filtering")
  #Step4: Include fitted results"
  bw_fitted<-tryCatch(cbind(bw, as.data.frame(fitted(reg1_res_sp)),
                            id = row.names(bw)), error=function(err) 
                            {print("NO NEIGHBORS"); data_sample})
  #Keeping track of indices
  #This will allow us to see exactly which observations were used in the regressions
  row.names(bw_fitted) <- bw_fitted$id
  bw_fitted<-subset(bw_fitted, select = -c(id))
  list_fitted_ei<-names(bw_fitted[, grepl("vec", names(bw_fitted))])
  list_fitted_ei<-list_fitted_ei[list_fitted_ei != "Shape"]
  all_vars<-append(x, list_fitted_ei)
  specification_with_eigenv = as.formula(paste(glue("{y}~"), 
                                               paste(all_vars, collapse = "+")))
  
  print(specification_with_eigenv)
  model1 <- tryCatch(lm(specification_with_eigenv, data = bw_fitted, na.action = na.exclude), error=function(err) NA)
  
  reg_moran<-moran.test(x=resid(model1),listw=list_nb_w, zero.policy = T)$statistic
  reg_moran_p<-moran.test(x=resid(model1),listw=list_nb_w, zero.policy = T)$p.value
  reg_moran_star<-paste(round(reg_moran, digits = 3), "",
                        ifelse(reg_moran_p<.01,"***",
                               ifelse(reg_moran_p<.05,"**",
                                      ifelse(reg_moran_p<.1,"*",
                                             ""))), "", "", sep = "")
  
  
  return(list(model1, reg_moran_star))
}


######################################
#Function for cleaning the list of FE#
#####################################

clean_list <- function(old_list, particle) {
  term <- paste(glue("^{particle}"))
  new_list = list() 
  for (i in old_list) {
    #print(i)
    temp_list = c()
    
    for (j in i){
      if (!grepl(term, j)){
        temp_list <- c(temp_list, j)
      }
    }
    l = length(new_list)
    new_list[[l+1]] <- temp_list
  }
  return(new_list)}


###############################
#Function for rerunning models#
###############################
rerun_regression<-function(regression_name, string_dv, orig_data_for_clusters, cluster_name){
  #Process:
  #-takes already existing regression objects, associates them with an 
  #"official" label, calculates robust clustered SE and CI based on a cluster
  #that is in the original dataset
  #and puts the results in a tibble
  #-this will be used for ggplot later
  
  #Input:
  #-Regression model object after lm
  #-The label for the DV that you want displayed in ggplot
  #-original dataset that contains thhe names of the clusters
  
  #Output:
  #-A tibble with regression coefficients from the model that you ran with:
  #--robust SE
  #--robust CI
  
  #Recreate dataframe from the regression object
  remake_data<-regression_name$model
  #Scale the DV
  remake_data[1]<-scale(remake_data[1])
  #Take the string of the DV and IV
  dv<-regression_name$terms[[2]]
  ivs<-regression_name$terms[[3]]
  ivs_str<-paste(ivs)[2]
  dv_str<-paste(dv, "~", collapse = "")
  dv_ivs_str<-paste(dv_str, ivs_str, sep=" ")
  #Create specification and run model
  specification = as.formula(dv_ivs_str)
  model <- lm(specification, data = remake_data)
  no_obs<-nobs(model)
  no_obs<-paste("Obs: ", as.character(no_obs), sep = "")
  #Calculate robust SE
  model_se<-se_robust_cluster(model, orig_data_for_clusters, cluster_name)
  #Create tibble
  model_tidy<-tidy(model)
  model_tidy$no_obs<-no_obs
  model_se_tidy<-tidy(model_se)
  names(model_se_tidy)[1] <- "term"
  names(model_se_tidy)[2] <- "robust.se"
  model_tidy2<-left_join(model_tidy, model_se_tidy, by = c("term"="term"))
  
  #Calculate CI
  df_ci<-as.data.frame(ci_robust_cluster(model, orig_data_for_clusters, cluster_name))
  df_ci <- cbind(term = rownames(df_ci), df_ci)
  names(df_ci)[2] <- "lb_95"
  names(df_ci)[3] <- "ub_95"
  
  #Merge CI to the dataframe
  model_tidy3<-left_join(model_tidy2, df_ci, by = c("term"="term"))
  #Only keep the treat variable
  model_tidy4<-subset(model_tidy3, term=="treat")
  model_tidy4$dv_official<-string_dv
  return(model_tidy4)
}


###########
#1857 Data#
###########
data_1857 <- st_read(dsn="./Dropbox/Legacies_Project/Analysis/data/data.gdb",
                     layer="census_1857_points")

data_1857<-st_drop_geometry(data_1857)
data_1857<-subset(data_1857, country=='Croatia')
data_1857<-subset(data_1857, select = c("original_order_id", "treat", "lon", "lat",
                                        "krajna6_NEAR_FID", "krajna6_distance", "NEAR_FID", "zagreb_distance"))

data_1857$dist1 <- as.numeric( with (data_1857,ifelse(data_1857$treat==1, 1, -1)))
data_1857$dist2 <-data_1857$dist1*(data_1857$krajna6_distance/1000)
data_1857$zagreb_distance<-data_1857$zagreb_distance/1000

data_1857$bfe1 <- ifelse(data_1857$krajna6_NEAR_FID == 1, 1,0)
data_1857$bfe2 <- ifelse(data_1857$krajna6_NEAR_FID == 2, 1,0)
data_1857$bfe3 <- ifelse(data_1857$krajna6_NEAR_FID == 3, 1,0)
data_1857$bfe4 <- ifelse(data_1857$krajna6_NEAR_FID == 4, 1,0)
data_1857$bfe5 <- ifelse(data_1857$krajna6_NEAR_FID == 5, 1,0)
data_1857$bfe6 <- ifelse(data_1857$krajna6_NEAR_FID == 6, 1,0)
data_1857$bfe7 <- ifelse(data_1857$krajna6_NEAR_FID == 7, 1,0)
data_1857$bfe8 <- ifelse(data_1857$krajna6_NEAR_FID == 8, 1,0)
data_1857$POINT_X<-data_1857$lon
data_1857$POINT_Y<-data_1857$lat


data_1857$quad1<-ifelse((data_1857$POINT_X > 18 & data_1857$POINT_X< 20) & 
                          (data_1857$POINT_Y<47  & data_1857$POINT_Y>44), 1, 0)

data_1857$quad2<-ifelse((data_1857$POINT_X > 16 & data_1857$POINT_X< 18) & 
                          (data_1857$POINT_Y<47  & data_1857$POINT_Y>44), 1, 0)

data_1857$quad3<-ifelse((data_1857$POINT_X > 14 & data_1857$POINT_X< 16) & 
                          (data_1857$POINT_Y<47  & data_1857$POINT_Y>44), 1, 0)

data_1857<-subset(data_1857, treat == 0 | treat == 1)


###################
#Prepare 1865 Data#
###################

excel_1857 = read_excel("./Dropbox/Legacies_Project/Analysis/data/census_1857.xlsx", 
                        sheet=1, col_names = TRUE, skip = 0)
data_1857 <-left_join(data_1857, excel_1857, by = c("original_order_id" = "original_order_id"))
data_1857$pct_military<-data_1857$military/data_1857$population*100
data_1857<-subset(data_1857, admin_name!="communitat" & place_german != "Arbe" & place_german != "Pago")

pct_military_1857 <- lm(pct_military~treat+
                            POINT_X+POINT_Y+zagreb_distance+
                            bfe1+bfe2+bfe3+bfe4+
                            bfe5+bfe6+bfe7+
                            quad1+ quad2 + quad3, 
                          data = data_1857)
summary(pct_military_1857)

###################
#Prepare 1900 Data#
###################

census_1900 <- st_read(dsn="./Dropbox/Legacies_Project/Analysis/data/data.gdb",
                       layer="hungarian_census_1900_points_final")
census_1900<-subset(census_1900, select = c("original_order", "final_lat", "final_lon", "treat",
                                            "HRV_adm0", "SRB_adm0", "ROU_adm0",
                                            "dist_zagreb",
                                            "dist_krajna_line_HRV_FID", "dist_krajna_line_HRV",
                                            "dist_krajna_line_SRB_FID", "dist_krajna_line_SRB",
                                            "dist_krajna_line_ROU_FID", "dist_krajna_line_ROU"))

hungarian_census_1900 = read_excel("./Dropbox/Legacies_Project/Analysis/data/census_1900_military.xlsx", 
                                      sheet="Volume1", col_names = TRUE, skip = 2)

census_1900 <-left_join(census_1900, hungarian_census_1900, by = c("original_order"="original_order"))
census_1900$pct_military_1900<-census_1900$military_present/census_1900$total_people*100
census_1900$bfe1 <- ifelse(census_1900$dist_krajna_line_HRV_FID == 1, 1,0)
census_1900$bfe2 <- ifelse(census_1900$dist_krajna_line_HRV_FID == 2, 1,0)
census_1900$bfe3 <- ifelse(census_1900$dist_krajna_line_HRV_FID == 3, 1,0)
census_1900$bfe4 <- ifelse(census_1900$dist_krajna_line_HRV_FID == 4, 1,0)
census_1900$bfe5 <- ifelse(census_1900$dist_krajna_line_HRV_FID == 5, 1,0)
census_1900$bfe6 <- ifelse(census_1900$dist_krajna_line_HRV_FID == 6, 1,0)
census_1900$bfe7 <- ifelse(census_1900$dist_krajna_line_HRV_FID == 7, 1,0)
census_1900$bfe8 <- ifelse(census_1900$dist_krajna_line_HRV_FID == 8, 1,0)
census_1900$dist0 <- census_1900$dist_krajna_line_HRV/1000
census_1900$zagreb_distance <-census_1900$dist_zagreb/1000
census_1900$dist1<- ifelse(census_1900$treat==1, 1, -1)
census_1900$dist2 <- census_1900$dist1*census_1900$dist0
census_1900$POINT_Y<-census_1900$final_lat
census_1900$POINT_X<-census_1900$final_lon


census_1900$quad1<-ifelse((census_1900$POINT_X > 18 & census_1900$POINT_X< 20) & 
                            (census_1900$POINT_Y<47  & census_1900$POINT_Y>44), 1, 0)

census_1900$quad2<-ifelse((census_1900$POINT_X > 16 & census_1900$POINT_X< 18) & 
                            (census_1900$POINT_Y<47  & census_1900$POINT_Y>44), 1, 0)

census_1900$quad3<-ifelse((census_1900$POINT_X > 14 & census_1900$POINT_X< 16) & 
                            (census_1900$POINT_Y<47  & census_1900$POINT_Y>44), 1, 0)

pct_military_1900 <- lm(pct_military_1900~treat+
                            POINT_X+POINT_Y+zagreb_distance+
                            bfe1+bfe2+bfe3+bfe4+
                            bfe5+bfe6+bfe7+
                            quad1+ quad2 + quad3, 
                          data = census_1900)



###################
#Prepare 1910 Data#
###################
census_1910 <- st_read(dsn="./Dropbox/Legacies_Project/Analysis/data/data.gdb",
                       layer="hungarian_census_1910_points_final")
census_1910<-st_drop_geometry(census_1910)

census_1910<-subset(census_1910, select = c("IDTel1910", "POINT_Y", "POINT_X", "treat",
                                            "HRV_adm0", "SRB_adm0", "ROU_adm0",
                                            "dist_zagreb",
                                            "dist_krajna_line_HRV_FID", "dist_krajna_line_HRV",
                                            "dist_krajna_line_SRB_FID", "dist_krajna_line_SRB",
                                            "dist_krajna_line_ROU_FID", "dist_krajna_line_ROU"))
census_1910$IDTel1910<-as.character(census_1910$IDTel1910)


hungarian_census_1910 = read_excel("./Dropbox/Legacies_Project/Analysis/data/census_1910_military.xlsx", 
                                   sheet='Volume1', col_names = TRUE, skip = 2)
hungarian_census_1910$alap_IDTel1910<-as.character(hungarian_census_1910$alap_IDTel1910)
census_1910<-right_join(census_1910, hungarian_census_1910, by = c("IDTel1910"="alap_IDTel1910"))

census_1910$pct_military_1910<-census_1910$military_present/census_1910$total_people*100
census_1910<-subset(census_1910, HRV_adm0==1)
census_1910$bfe1 <- ifelse(census_1910$dist_krajna_line_HRV_FID == 1, 1,0)
census_1910$bfe2 <- ifelse(census_1910$dist_krajna_line_HRV_FID == 2, 1,0)
census_1910$bfe3 <- ifelse(census_1910$dist_krajna_line_HRV_FID == 3, 1,0)
census_1910$bfe4 <- ifelse(census_1910$dist_krajna_line_HRV_FID == 4, 1,0)
census_1910$bfe5 <- ifelse(census_1910$dist_krajna_line_HRV_FID == 5, 1,0)
census_1910$bfe6 <- ifelse(census_1910$dist_krajna_line_HRV_FID == 6, 1,0)
census_1910$bfe7 <- ifelse(census_1910$dist_krajna_line_HRV_FID == 7, 1,0)
census_1910$bfe8 <- ifelse(census_1910$dist_krajna_line_HRV_FID == 8, 1,0)
census_1910$dist0 <- census_1910$dist_krajna_line_HRV/1000
census_1910$zagreb_distance <-census_1910$dist_zagreb/1000
census_1910$dist1<- ifelse(census_1910$treat==1, 1, -1)
census_1910$dist2 <- census_1910$dist1*census_1910$dist0


census_1910$quad1<-ifelse((census_1910$POINT_X > 18 & census_1910$POINT_X< 20) & 
                         (census_1910$POINT_Y<47  & census_1910$POINT_Y>44), 1, 0)

census_1910$quad2<-ifelse((census_1910$POINT_X > 16 & census_1910$POINT_X< 18) & 
                         (census_1910$POINT_Y<47  & census_1910$POINT_Y>44), 1, 0)

census_1910$quad3<-ifelse((census_1910$POINT_X > 14 & census_1910$POINT_X< 16) & 
                         (census_1910$POINT_Y<47  & census_1910$POINT_Y>44), 1, 0)


pct_military_1910 <- lm(pct_military_1910~treat+
                            POINT_X+POINT_Y+zagreb_distance+
                            bfe1+bfe2+bfe3+bfe4+
                            bfe5+bfe6+bfe7+
                            quad1+ quad2 + quad3,
                        data = census_1910)
summary(pct_military_1910)

###################
#Prepare 1931 Data#
###################
census_1931_srez_dist <- st_read(dsn="./Dropbox/Legacies_Project/Analysis/data/data.gdb",
                                 layer="census_1931_points")
census_1931_srez<-st_drop_geometry(census_1931_srez_dist)
census_1931_srez$treat<-census_1931_srez$treat
census_1931_srez$dist1 <- as.numeric( with (census_1931_srez,ifelse(census_1931_srez$treat==1, 1, -1)))
census_1931_srez$krajna6_distance<-census_1931_srez$krajna6_distance/1000
census_1931_srez$zagreb_distance<-census_1931_srez$zagreb_distance/1000
census_1931_srez <- subset(census_1931_srez, treat == "1" | treat == "0")

census_1931_srez$dist2 <-census_1931_srez$dist1*census_1931_srez$krajna6_distance
census_1931_srez$bfe1 <- ifelse(census_1931_srez$krajna6_NEAR_FID == 1, 1,0)
census_1931_srez$bfe2 <- ifelse(census_1931_srez$krajna6_NEAR_FID == 3, 1,0)
census_1931_srez$bfe3 <- ifelse(census_1931_srez$krajna6_NEAR_FID == 4, 1,0)
census_1931_srez$bfe4 <- ifelse(census_1931_srez$krajna6_NEAR_FID == 5, 1,0)
census_1931_srez$bfe5 <- ifelse(census_1931_srez$krajna6_NEAR_FID == 6, 1,0)
census_1931_srez$bfe6 <- ifelse(census_1931_srez$krajna6_NEAR_FID == 7, 1,0)
census_1931_srez$bfe7 <- ifelse(census_1931_srez$krajna6_NEAR_FID == 8, 1,0)
census_1931_srez$bfe8 <- ifelse(census_1931_srez$krajna6_NEAR_FID == 9, 1,0)


census_1931_srez$quad1<-ifelse((census_1931_srez$POINT_X > 18 & census_1931_srez$POINT_X< 20) & 
                     (census_1931_srez$POINT_Y<47  & census_1931_srez$POINT_Y>44), 1, 0)

census_1931_srez$quad2<-ifelse((census_1931_srez$POINT_X > 16 & census_1931_srez$POINT_X< 18) & 
                                 (census_1931_srez$POINT_Y<47  & census_1931_srez$POINT_Y>44), 1, 0)

census_1931_srez$quad3<-ifelse((census_1931_srez$POINT_X > 14 & census_1931_srez$POINT_X< 16) & 
                                 (census_1931_srez$POINT_Y<47  & census_1931_srez$POINT_Y>44), 1, 0)

census_1931_excel<-read_excel("./Dropbox/Legacies_Project/Data/historical_censuses/census_1931/census_1931_srez.xlsx",
                              sheet=1, col_names = TRUE, skip = 0)

census_1931_combined<-left_join(census_1931_srez, census_1931_excel, by = c("srez_name"="srez_name"))
census_1931_combined$pubserv_bureaucrats_pct<-census_1931_combined$pubserv_bureaucrats/census_1931_combined$pubserv_all*100

pubserv_bureaucrats_pct<-lm(pubserv_bureaucrats_pct~treat+
                                POINT_X+POINT_Y+zagreb_distance+
                                bfe1+bfe2+
                                bfe3+bfe4+
                                bfe5+bfe6+
                                bfe7+
                                quad1+quad2+quad3,
                              data=census_1931_combined)
summary(pubserv_bureaucrats_pct)


###################
#Prepare 2011 Data#
###################
data <- read_excel("./Dropbox/Legacies_Project/Analysis/data/merge.xlsx", sheet=1, col_names = TRUE, skip = 0)
data$treat <- as.numeric( with (data,ifelse((data$treat_KRAJ_kraj6==1), 1, 0)))
data$dist1 <- as.numeric( with (data,ifelse(data$treat==1, 1, -1)))
data$dist2 <-data$dist1*data$krajna6_distance


HRV_adm3 <- st_read(dsn="./Dropbox/Legacies_Project/Analysis/data/data.gdb",
                    layer="HRV_adm3")
HRV_adm3<-st_simplify(HRV_adm3, dTolerance = 0.005)
HRV_adm3<-subset(HRV_adm3, select = c(ID_2))
HRV_adm3_data = read_excel("./Dropbox/Legacies_Project/Analysis/data/merge.xlsx", sheet=1, col_names = TRUE, skip = 0)
data<-left_join(HRV_adm3, HRV_adm3_data, by = c("ID_2"="ID_2"))
data$dist1 <- as.numeric( with (data,ifelse(data$treat==1, 1, -1)))
data$dist2 <-data$dist1*data$krajna6_distance

#Removing NAs
data_nona<-subset(data, select = c(pct_amred_forces_1991, pct_amred_forces_2011, treat,
                                   POINT_X, POINT_Y, zagreb_distance,
                                   bfe1, bfe2, bfe3, bfe4, bfe5, bfe6,
                                   bfe7, quad1, quad2, quad3, NAME_2, NAME_1))
data_nona<-na.omit(data_nona)


pct_amred_forces_1991<-lm(pct_amred_forces_1991 ~ treat+
                            POINT_X+POINT_Y+zagreb_distance+
                            bfe1+bfe2+
                            bfe3+bfe4+
                            bfe5+bfe6+
                            bfe7+
                            quad1+quad2+quad3,
                          data=data_nona)
summary(pct_amred_forces_1991)



relevant_vars<-c("pct_military_1857", 
                 "pct_military_1900", 
                 "pct_military_1910", 
                 "pubserv_bureaucrats_pct", 
                 "pct_amred_forces_1991")


list_models<-list(pct_military_1857,
                  pct_military_1900,
                  pct_military_1910,
                  pubserv_bureaucrats_pct,
                  pct_amred_forces_1991)


column_labels= c("\\shortstack{Pct. Military\\\\ 1857}", 
                 "\\shortstack{Pct. Military\\\\ 1900}",
                 "\\shortstack{Pct. Military\\\\ 1910}",
                 "\\shortstack{Pct. People in\\\\ Public Service and Army\\\\ 1931}",
                 "\\shortstack{Pct. Armed Forcces\\\\ 1991}")



mean_pct_military<-round(mean(data_1857$pct_military, na.rm=T), digits = 3)
mean_pct_military_1900<-round(mean(census_1900$pct_military_1900, na.rm=T), digits = 3)
mean_pct_military_1910<-round(mean(census_1910$pct_military_1910, na.rm=T), digits = 3)
mean_pubserv_bureaucrats_pct<-round(mean(census_1931_combined$pubserv_bureaucrats_pct, na.rm=T), digits = 3)
mean_pct_amred_forces_1991<-round(mean(data_nona$pct_amred_forces_1991, na.rm=T), digits = 3)

means<-c(mean_pct_military,
            mean_pct_military_1900,
            mean_pct_military_1910,
            mean_pubserv_bureaucrats_pct,
            mean_pct_amred_forces_1991)

sd_pct_military<-round(sd(data_1857$pct_military, na.rm=T), digits = 3)
sd_pct_military_1900<-round(sd(census_1900$pct_military_1900, na.rm=T), digits = 3)
sd_pct_military_1910<-round(sd(census_1910$pct_military_1910, na.rm=T), digits = 3)
sd_pubserv_bureaucrats_pct<-round(sd(census_1931_combined$pubserv_bureaucrats_pct, na.rm=T), digits = 3)
sd_pct_amred_forces_1991<-round(sd(data_nona$pct_amred_forces_1991, na.rm=T), digits = 3)

sds<-c(sd_pct_military,
            sd_pct_military_1900,
            sd_pct_military_1910,
            sd_pubserv_bureaucrats_pct,
            sd_pct_amred_forces_1991)

armed_forces =stargazer(list_models,
                        object.names = F,
                        column.labels= column_labels,
                        keep = c("treat"),
                        covariate.labels=c("Military Territory"),
                        dep.var.caption = "Dependent variable:",
                        dep.var.labels.include = F,
                        omit.stat=c("LL","ser","f", "rsq"), no.space=TRUE, float=FALSE,
                        add.lines=list(c("Mean", means),
                                       c("SD", sds),
                                       c("Boundary FE", rep("Yes", 9)),
                                       c("Survey Year FE", rep("Yes", 9)),
                                       c("Demographic Covariates", rep("Yes", 9))))
note_latex <- "\\multicolumn{6}{l} {\\parbox[t]{22cm}{ \\footnotesize \\textit{Notes:} 
Coefficients and County clustered robust standard errors in parantheses from OLS regressions.
$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01. All regressions include a linear RD polynomial in latitude and longitude,
a control for distance to Zagreb, and boundary segment fixed effects. 
See codebook for data sources and how the variables were calculated.}}"
armed_forces [grepl("Note", armed_forces)] <- note_latex
cat(armed_forces, file="./Dropbox/Legacies_Project/Paper/tables/table_A19.tex", sep="\n")
